package 集合.stackExamples;

import javax.sound.midi.Soundbank;
import java.util.ArrayList;
import java.util.Stack;

public class StackUse {
	public static void main(String[] args) {
		Stack<String> stacks = new Stack<>();
		for (String s : "1234567".split("")) {
			stacks.push(s);
		}
		// 因为stack先进后出
		while (!stacks.empty()) {
			System.out.print(stacks.pop() + " ");

		}
	}

}

